home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / tcp / AmigaTCP.lha / AmigaTCP / src / inetdev.h < prev    next >
C/C++ Source or Header  |  1989-06-24  |  2KB  |  79 lines

  1. /*
  2.  *  Copyright (C) 1987
  3.  *  Louis A. Mamakos  WA3YMH
  4.  *  All rights reserved.
  5.  *
  6.  *  This code may not be redistributed, sold, included on any collection of
  7.  *  software which is sold.  Use of this software is restricted to inclusion
  8.  *  in the KA9Q TCP/IP software package for use on a Commodore-Amiga system.
  9.  *  Commercial use is prohibited.  Only educational and Amateur Packet Radio
  10.  *  use is allowed.
  11.  */
  12.  
  13. #ifndef    EXEC_SEMAPHORES_H
  14. #include <exec/semaphores.h>
  15. #endif
  16.  
  17.  
  18. struct InternetBase {
  19.     struct Library lib;
  20.  
  21.     /* use AttemptSemaphore()/ObtainSemaphore()/ReleaseSemaphore() */
  22.     struct SignalSemaphore ib_lock;
  23.  
  24.     /* add any user visible variables here */
  25.     struct List    ib_Units;
  26. } *InternetBase;
  27.  
  28.  
  29. struct IOINETReq {
  30.     struct    Message    io_Message;
  31.     struct    Device    *io_Device;    /* device node pointer */
  32.     struct INET_Unit    *io_Unit;        /* unit (driver private) */
  33.     UWORD    io_Command;        /* device command */
  34.     UBYTE    io_Flags;
  35.     BYTE    io_Error;
  36.     ULONG    io_Actual;
  37.     ULONG    io_Length;
  38.     APTR    io_Data;
  39.     ULONG    io_Offset;
  40.     union {
  41.         struct TCP_state_u {
  42.             UBYTE    io_u_OldState;    /* old TCP state */
  43.             UBYTE    io_u_State;    /* new tcp state */
  44.         } io_TCP_State_u;
  45.         /* add more members of union here (protocol specific) */
  46.     } io_INET_u;
  47.     struct    socket io_lsocket;    /* local socket address */
  48.     struct    socket io_fsocket;    /* remote socket address */
  49.  
  50. /* parameters used on OpenDevice() only */
  51. #define    io_TCP_Window    io_Length
  52. #define    io_INET_TOS    io_Actual
  53.  
  54. /* define easier to use names for members of protocol specific status union */
  55. #define    io_OldState    io_INET_u.io_TCP_State_u.io_u_OldState
  56. #define io_State    io_INET_u.io_TCP_State_u.io_u_State
  57.  
  58. };
  59.  
  60.  
  61. struct INET_Unit {
  62.     struct    Node iu_Unit;        /* list thread */
  63.     struct    List iu_Input;        /* queue of read requests */
  64.     struct    List iu_Output;        /* queue of write reqeusts */
  65.     struct    IOINETReq *iu_Act_Input;/* current active input request */
  66.     struct    IOINETReq *iu_Act_Output;/* current active output request */
  67.     void    *iu_ccb;        /* generic control block 
  68.                        (TCP/UDP protocol specific) */
  69.     ULONG    iu_user;        /* user supplied "cookie" */
  70.     ULONG    iu_type;        /* type of connection (UDP/TCP..) */
  71. };
  72.  
  73. #define IN_VERSION    1
  74. #define IN_REVISION    0
  75.  
  76. #define INET_UNIT_RAW    0L
  77. #define    INET_UNIT_TCP    1L
  78. #define    INET_UNIT_UDP    2L
  79.